using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using QuanLyKhachSan.DTO;
using QuanLyKhachSan.DAO;

namespace QuanLyKhachSan.BUS
{
    public class PhieuThuePhongBUS
    {
        public enum PhieuThuePhongBUSResult
        {
            OK,
            SONGAYTHUEERROR,
            HESOTHUEERROR,
            PHUTHUTHUEERROR,
            DONGIATHUEERROR,
            DAOERROR
        }

        public static DataTable LayDSPhieuThue()
        {
            return PhieuThuePhongDAO.LayDSPhieuThue();
        }

        public static PhieuThuePhongBUSResult Insert(PhieuThuePhongDTO phieuThuedto)
        {
            if (!PhieuThuePhongDAO.Insert(phieuThuedto))
                return PhieuThuePhongBUSResult.DAOERROR;
            return PhieuThuePhongBUSResult.OK;
        }
        public static DataTable LayMaPhieuThueTheoMaPhong(int maPhong)
        {
            return PhieuThuePhongDAO.LayMaPhieuThueTheoMaPhong(maPhong);
        }
        public static int LayMaPhieuThueMoiThem()
        {
            DataTable dt = new DataTable();
            dt = PhieuThuePhongDAO.LayMaPhieuThueMoiThem();
            DataRow dr = dt.Rows[0];
            return int.Parse(dr[0].ToString());
        }
    }
}
